#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
void left_arr(char a[],int k,int l)
{
	while (l--)
	{
		int lf = a[0];
		for (int q = 0; q < k - 1; q++)
		{
			a[q] = a[q + 1];
		}
		a[k - 2] = lf;
	}
}
int main()
{
	char arr[5] = { "ABCD" };
	int ret = 5;
	int l = 0;
	scanf("%d", &l);
	left_arr(arr,ret,l);
	for (int i = 0; i < ret; i++)
	{
		printf("%c ", arr[i]);
	}
	return 0;
}